
<script type = "text/javascript">
function confirm_me(){
	return confirm("Are you sure you want to delete these classes?");
}</script>

<h2>Manage Classes</h2>
<h3>List of subjects offered</h3>
<table id="sub" class="tablesorter"><thead class = "forms">
<tr><th>Manage</td><th>Subject Name</th><th>Description</th></tr></thead><tbody>
<?php foreach($classes->result() as $test){ 
		echo form_open('admin/delete_class', array('onsubmit' => 'return confirm_me()'));
		$index = 0;
		$subjectid = $test->subjectid;
		$subjectname = $test->subjectname;
		$id = "chkDel".$index;?>
		<tr><td><?php echo "<input type='checkbox' id=\"$id\" name='class[]' value='$subjectid'>"; ?></td>

		<td><?php echo form_label($subjectname, $subjectid); ?></td>
		<td><?php echo $test->description;?></td></tr>
		<?php $index++; } ?>
</tbody></table>
<?php echo form_submit('delete', 'Delete Class'); echo form_close(); ?>

<h3>Add a class</h3>
<?php echo form_open('admin/manage_class'); ?>
Subject Name: <br /><?php echo form_input(array('name' => 'subjectname', 'size' => '40'));?> <br />
Short Description of the subject: <br /><textarea name="description" cols=60 rows=6>Mini description of the class..</textarea><br /><br />

<?php echo form_submit('add', 'Add Class'); ?> 
<?php echo form_close(); ?>
